package options

import (
	"github.com/spf13/pflag"
	"time"
)

type Config struct {
	StepsFile        string
	ResultDir string
	ImagesPath     string
	ImageX int
	ImageY int
	ImageWidth int
	ImageHeight int
	MaxAppLifeTime time.Duration
}

func (cfg *Config) AddFlags(flags *pflag.FlagSet) {
	flags.StringVar(&cfg.ResultDir, "resultDir", "/home/wanlei/Desktop/wanlei/auto_click_server/test", "the test result file dir")
	flags.StringVar(&cfg.StepsFile, "stepsFile", "/home/wanlei/Desktop/wanlei/auto_click_server/test/steps", "the steps file")
	flags.StringVar(&cfg.ImagesPath, "imagesPath", "/home/wanlei/Desktop/wanlei/auto_click_server/images", "the snapshot dir")
	// 下面四个参数废弃
	flags.IntVar(&cfg.ImageX,"imageX",90,"image point x")
	flags.IntVar(&cfg.ImageY,"imageY",95,"image point y")
	flags.IntVar(&cfg.ImageWidth,"imageWidth",550,"image point imageWidth")
	flags.IntVar(&cfg.ImageHeight,"imageHeight",250,"image point imageHeight")
	flags.DurationVar(&cfg.MaxAppLifeTime,"maxAppLifeTime",15*time.Minute,"max app life time")
}
